#define DEBUG
#pragma GCC optimize("O3")
#include <cstdio>

using namespace std;

const int maxn=2000000, inf=0x7fffffff;

int min(int a, int b) {
  return a<b ? a : b;
}

int max(int a, int b) {
  return a>b ? a : b;
}

class SegmentTree {
public:
  int a[4*maxn+5];

  void init(int inf) {
    for (int i=1; i<=4*maxn+4; i++) {
      a[i] = inf;
    }
  }

  void set(int o, int l, int r, int t, int v) {
    if (l==r) {
      a[o] = min(a[o], v);
    } else {
      int mid=(l+r)/2;
      if (t<=mid) {
	set(o*2, l, mid, t, v);
      } else {
	set(o*2+1, mid+1, r, t, v);
      }
      a[o] = min(a[o*2], a[o*2+1]);
    }
  }

  int get(int o, int l, int r, int tl, int tr) {
    if (l==tl && r==tr) {
      return a[o];
    } else {
      int mid=(l+r)/2, ret=inf;
      if (tl<=mid && tr>=l) {
	ret = min(ret, get(o*2, l, mid, max(tl, l), min(tr, mid)));
      }
      if (tl<=r && tr>mid) {
	ret = min(ret, get(o*2+1, mid+1, r, max(tl, mid+1), min(tr, r)));
      }
      return ret;
    }
  }
};

int read() {
  char c;
  int ret=0;
  for (c=getchar(); c<'0' || c>'9'; c=getchar());
  for (; c>='0' && c<='9'; c=getchar()) {
    ret = ret*10+c-'0';
  }
  return ret;
}

int main() {
#ifdef DEBUG
  freopen("2.in", "r", stdin);
  freopen("2.out", "w", stdout);
#endif

  static int f[maxn+1], s[maxn+1];
  int n;
  n=read(), s[0]=read();
  for (int i=1; i<=n; i++) {
    s[i] = s[i-1]+read();
  }

  static SegmentTree sgt;
  sgt.init(inf);
  int minf = inf;
  f[0] = 0;
  if (s[0]/100-f[0]<=n) {
    sgt.set(1, 0, n, s[0]/100-f[0], f[0]);
  } else {
    minf = min(minf, f[0]);
  }
  sgt.set(1, 0, n, 0, 0);
  for (int i=1; i<=n; i++) {
    f[i] = min(sgt.get(1, 0, n, i, n), minf)+i;
    if (f[i]<0) {
      f[i] = inf;
    }
    if (f[i]<inf) {
      if (s[i]/100-f[i]<=n) {
	sgt.set(1, 0, n, s[i]/100-f[i], f[i]);
      } else {
	minf = min(minf, f[i]);
      }
    }
  } 

  if (f[n]*100>s[n]) {
    printf("-1");
  } else {
    printf("%d", s[n]-100*f[n]);
  }

  fclose(stdin);
  fclose(stdout);
  return 0;
}
